<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/lreport/bomreport/BOMReport.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/lreport/bomreport/BOMReport.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'BOMReportId',
                footer: "Foots",
                cnName: 'BOM工单',
                name: 'bomreport/BOMReport',
                url: "/BOMReport/",
                sortName: "CreateDate"
            });
            const editFormFields = ref({"BOMReportTitle":"","BOMVersion":"","IsDefaultBOM":"","ArtifactType":"","Output":"","Description":"","Attachment":"","ProductId":""});
            const editFormOptions = ref([[{"title":"BOM工单主题","required":true,"field":"BOMReportTitle","type":"text"},
                               {"title":"版本","field":"BOMVersion","type":"text"}],
                              [{"title":"默认BOM","required":true,"field":"IsDefaultBOM","type":"switch"},
                               {"dataKey":"ProductType","data":[],"title":"成品类型","required":true,"field":"ArtifactType","type":"select"}],
                              [{"title":"日产量","required":true,"field":"Output","type":"text"}],
                              [{"title":"描述","field":"Description"},
                               {"title":"附件","field":"Attachment","type":"file"}],
                              [{"dataKey":"WProductInfo","data":[],"title":"成品","required":true,"field":"ProductId","type":"select"}]]);
            const searchFormFields = ref({"BOMReportTitle":"","BOMVersion":""});
            const searchFormOptions = ref([[{"title":"BOM工单主题","field":"BOMReportTitle","type":"like"},{"title":"版本","field":"BOMVersion","type":"like"}]]);
            const columns = ref([{field:'BOMReportId',title:'BOM工单主键',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'BOMReportTitle',title:'BOM工单主题',type:'string',width:180,require:true,align:'left',sort:true},
                       {field:'BOMVersion',title:'版本',type:'string',width:180,align:'left'},
                       {field:'IsDefaultBOM',title:'默认BOM',type:'int',width:110,require:true,align:'left'},
                       {field:'ArtifactType',title:'成品类型',type:'int',bind:{ key:'ProductType',data:[]},width:110,require:true,align:'left'},
                       {field:'Output',title:'日产量',type:'int',width:110,require:true,align:'left'},
                       {field:'Description',title:'描述',type:'string',width:180,align:'left'},
                       {field:'Attachment',title:'附件',type:'string',width:180,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:110,align:'left',sort:true},
                       {field:'Creator',title:'创建人',type:'string',width:130,require:true,align:'left'},
                       {field:'ProductId',title:'成品',type:'guid',bind:{ key:'WProductInfo',data:[]},width:110,require:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
